<?php
require_once 'libs/Smarty.class.php';
require_once 'staticdata.php';
require_once 'include/config.inc.php';
function level( $params )
{
	extract( $params );
	return '<img src="images/level_'.$l.'.gif" />'; 
}
class TopSmartyBase
{
	private $_smarty;
	private $_lang;
	function __construct()
	{
		$this->_smarty = new Smarty;
		$this->_lang = include('lang.php');
		$this->_smarty->debugging = false;
		#$this->_smarty->caching = true;
		#$this->_smarty->cache_lifetime = 240;
		$this->_smarty->assign('topnav', StaticData::getMenuData());
		$this->_smarty->assign('smallnav', StaticData::getSmallNav());
		$this->_smarty->assign('sort', StaticData::getSort());
		$this->_smarty->assign('lang', $this->_lang);
		$this->_smarty->assign('sitename', SITENAME);
		$this->_smarty->register_function('print_img', 'print_img');
		$this->_smarty->register_function('level', 'level');
	}
	
	function getSmarty()
	{
		return $this->_smarty;
	}
}